//
//  YKRecommendTagCell.m
//  百思不得姐
//
//  Created by Eric.Wu on 16/2/26.
//  Copyright © 2016年 Eric.Wu. All rights reserved.
//

#import "YKRecommendTagCell.h"
#import "YKRecommmendTag.h"
#import "UIImageView+WebCache.h"
@interface YKRecommendTagCell()

@property (weak, nonatomic) IBOutlet UIImageView *recommendIcon;

@property (weak, nonatomic) IBOutlet UILabel *recommrndLable;

@property (weak, nonatomic) IBOutlet UILabel *recommendFans;

@property (weak, nonatomic) IBOutlet UIButton *FocusButton;

@end
@implementation YKRecommendTagCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"recommendTag";
    YKRecommendTagCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
    }
    return cell;
}


- (void)setRecommendTag:(YKRecommmendTag *)recommendTag
{
    _recommendTag = recommendTag;
    [self.recommendIcon sd_setImageWithURL:[NSURL URLWithString:recommendTag.image_list] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
    self.recommrndLable.text = recommendTag.theme_name;
    
    
    NSString *fanscount = nil;
    if (recommendTag.sub_number < 10000) {
        fanscount =  [NSString stringWithFormat:@"%zd人关注",recommendTag.sub_number];
    }else{
        fanscount = [NSString stringWithFormat:@"%.1f万人关注",recommendTag.sub_number/10000.0];
    }
    self.recommendFans.text = fanscount;
}
- (void)awakeFromNib {
   
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    
}
- (void)setFrame:(CGRect)frame
{
    frame.origin.x = 10;
    frame.size.width -= 2*frame.origin.x ;
    frame.origin.y -= 1;
    [super setFrame:frame];
    
}

@end
